<template>
  <div class="common-layout">
    <el-container style="height: 100vh">
      <el-header class="header">
        <Header />
        <!-- <el-button @click="handleLoginOut">退出</el-button> -->
      </el-header>
      <el-container>
        <el-aside width="auto"><Menu /></el-aside>
        <el-main><router-view class="display_box"></router-view></el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
import '@/assets/css/home.scss';
import Menu from '../../components/Menu/index.vue';
import Header from '../../components/Header/index.vue';
import { defineComponent } from 'vue';
import { useRouter } from 'vue-router';
import { useStore } from 'vuex';
export default defineComponent({
  components: {
    Menu,
    Header,
  },
  setup() {
    const router = useRouter();
    const store = useStore();
    const handleLoginOut = () => {
      store.commit('login/clearToken', '');
      localStorage.removeItem('token');
      router.push({ name: 'Login' });
    };

    return {
      handleLoginOut,
    };
  },
});
</script>